<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="button" value="点我一下" onclick="alert('haha')">

    <script>
        //对象

        let student = {
            "name":"zhangsan",
            "age": 18,
            "id": 12,
            "say": function(){
                console.log("hello");
            }
        };
        student['name'] = "lisi";
        student["aa"] = "aa";
        console.log(student['aa']);


        //函数
        // function add(x, y){
        //     console.log(x+y);
        // }

        // add(1,2);
        // add(1,2,3);
        // add(5);
        // add("a");
        //数组
        // let arr = new Array();
        // console.log(typeof arr);
        // arr[5] = 5;
        // console.log(arr);
        // console.log(arr[2]);
        // console.log(arr[5]);


        
        // let arr2 = [1,"a", true, 3];
        // arr2[3] = "update";
        // console.log(arr2[3]);
        // arr2.splice(2,1);
        // console.log(arr2);

        // arr2["hello"] = "javascript";
        // console.log(arr2);

        //运算符
        // let a = 10/4;
        // console.log(a);

        // let b = 20;
        // let c = "20";
        // let d = 20;

        // console.log("b==c:"+(b==c))
        // console.log("b===c:"+(b===c))

        // console.log("b==d:"+(b==d))
        // console.log("b===d:"+(b===d))

        //类型演示
        // let aa = "zhangsan";
        // console.log(typeof aa);

        // aa = 10;
        // console.log(typeof aa);

        // aa = true;
        // console.log(typeof aa);

        // let bb;
        // console.log(typeof bb);
        // alert("hello, script")
    </script>
</body>
</html>